#pragma once

#include <d3d9.h>
#include <d3dx9.h>

#include "Vector4.h"
#include "Vector3.h"
#include "Vector2.h"

struct VertexType
{
	enum Type
	{
		POS3D,
		POS3UV,
		POS4DUV,
		POS3ND,
		POS3NUV
	};

	Type		m_type;
	std::string m_typeStr;
	std::string m_format;
	int			m_size;
	DWORD		m_fvf;
};

struct VertexPos3D
{
	Vector3 m_pos;
	DWORD m_diffuse;

	static DWORD GetFVF()
	{
		return D3DFVF_XYZ | D3DFVF_DIFFUSE;
	}
};

struct VertexPos3UV
{
	Vector3 m_pos;
	Vector2 m_uv;

	static DWORD GetFVF()
	{
		return D3DFVF_XYZ | D3DFVF_TEX1;
	}
};

struct VertexPos4DUV
{
	Vector4 m_pos;
	DWORD m_diffuse;
	Vector2 m_uv;

	static DWORD GetFVF()
	{
		return D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1;
	}
};

struct VertexPos3ND
{
	Vector3 m_pos;
	Vector3 m_normal;
	DWORD m_diffuse;

	static DWORD GetFVF()
	{
		return D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_DIFFUSE;
	}
};

struct VertexPos3NUV
{
	Vector3 m_pos;
	Vector3 m_normal;
	Vector2 m_uv;

	static DWORD GetFVF()
	{
		return D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_TEX1;
	}
};
